<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>H+ 后台主题UI框架 - 登录</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link href="__ACSS__/bootstrap.min.css" rel="stylesheet">
    <link href="__ACSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__ACSS__/animate.min.css" rel="stylesheet">
    <link href="__ACSS__/style.min.css" rel="stylesheet">
    <link href="__ACSS__/login.min.css" rel="stylesheet">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if(window.top!==window.self){window.top.location=window.location};
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[ H+ ]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>H+ 后台主题UI框架</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势一</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势二</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势三</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势四</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势五</li>
                    </ul>
                    <strong>还没有账号？ <a href="#">立即注册&raquo;</a></strong>
                </div>
            </div>
            <div class="col-sm-5">
               <form id="doLogin" method="post" action="{:url('login/login')}">
						<h4 class="no-margins">登录：</h4>
						<input type="text" id="admin_name" name="admin_name" class="form-control uname" placeholder="登录账户" />
						<input type="password" id="admin_pwd" name="admin_pwd" class="form-control pword m-b" placeholder="登录密码" />
						<input type="text" id="verify" name="verify" maxlength="4" class="form-control yzm m-b" style="color: #000000;" placeholder="验证码" autocomplete="off" /> 
			    <img id="verify_img" src="{:captcha_src()}" alt="验证码" onclick="refreshVerify()">			
						<button type="submit" class="btn btn-success btn-block">登 录</button>
					</form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2015 All Rights Reserved. H+
            </div>
        </div>
    </div>
</body>
		<script src="__AJS__/jquery.min.js"></script>
		<script src="__AJS__/bootstrap.min.js"></script>
		<script src="__AJS__/jquery.form.js"></script>
		<script src="__ALAYER__/layer.js"></script>
<script>
    function refreshVerify() {
        var ts = Date.parse(new Date())/1000;
        var img = document.getElementById('verify_img');
        img.src = "/captcha?id="+ts;
    }
</script>
		<script>
			$(function() {
				$('#doLogin').ajaxForm({
					beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置      
					success: complete, // 这是提交后的方法
					dataType: 'json'
				});

				function checkForm() {
					if('' == $.trim($('#admin_name').val())) {
						layer.msg('请输入登录用户名');
						return false;
					}

					if('' == $.trim($('#admin_pwd').val())) {
						layer.msg('请输入登录密码');
						return false;
					}

					if('' == $.trim($('#verify').val())) {
						layer.msg('请输入验证码');
						return false;
					}

					$("button").removeClass('btn-primary').addClass('btn-danger').text("登录中...");
				}

				function complete(info) {
					if(info.code == 200) {
						layer.msg(info.msg);
						window.location.href = info.data;
					} else {
						layer.msg(info.msg);
						$("button").removeClass('btn-danger').addClass('btn-primary').text("登 录");
						$("#verify").val("");
						$(".captcha").click();
						refreshVerify();
						return false;
					}

				}

			});
		</script>
</html>